package sy.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * SysProject entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "sys_project", catalog = "ssh")
public class SysProject implements java.io.Serializable {

	// Fields

	private String id;
	private SysDivision sysDivision;
	private String name;
	private String code;//机房远程监控项目编号
	private String latitude;//纬度
	private String longitude;//经度
	private String ccProjectCode;//中海项目编号
	private String entranceCode;//迈斯项目编号
	private String patrolCode;//巡更项目编号
	private String parkingCode;//停车场项目编号

	@JsonProperty(value = "divisionName")
    private String divisionName;

	// Constructors

	/** default constructor */
	public SysProject() {
	}

	/** full constructor */
	public SysProject(SysDivision sysDivision, String name, String code,String latitude,String longitude) {
		this.sysDivision = sysDivision;
		this.name = name;
		this.code = code;
		this.latitude = latitude;
		this.longitude = longitude;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.string")
	@Id
	@Column(name = "id", unique = true, nullable = false, length = 64)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.EAGER, optional = false)
	@JoinColumn(name = "division")
	public SysDivision getSysDivision() {
		return this.sysDivision;
	}
	
	public void setSysDivision(SysDivision sysDivision) {
		this.sysDivision = sysDivision;
	}

	@Transient
	public String getDivisionName() {
		return getSysDivision().getName();
	}
	
	public void setDivisionName(String divisionName) {
		this.divisionName = divisionName;
	}

	@Column(name = "name")
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "code")
	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	@Column(name = "latitude")
	public String getLatitude() {
		return latitude;
	}

	public void setLatitude(String latitude) {
		this.latitude = latitude;
	}

	@Column(name = "longitude")
	public String getLongitude() {
		return longitude;
	}

	public void setLongitude(String longitude) {
		this.longitude = longitude;
	}
	@Column(name = "ccProjectCode")
	public String getCcProjectCode() {
		return ccProjectCode;
	}

	public void setCcProjectCode(String ccProjectCode) {
		this.ccProjectCode = ccProjectCode;
	}

	@Column(name = "entranceCode")
	public String getEntranceCode() {
		return entranceCode;
	}

	public void setEntranceCode(String entranceCode) {
		this.entranceCode = entranceCode;
	}
	@Column(name = "patrolCode")
	public String getPatrolCode() {
		return patrolCode;
	}

	public void setPatrolCode(String patrolCode) {
		this.patrolCode = patrolCode;
	}
	@Column(name = "parkingCode")
	public String getParkingCode() {
		return parkingCode;
	}

	public void setParkingCode(String parkingCode) {
		this.parkingCode = parkingCode;
	}

}
